//
//  COVIViewController.m
//  Runone
//
//  Created by runone01 on 16/10/24.
//  Copyright © 2016年 runone. All rights reserved.
//

#import "COVIViewController.h"
#import "MJExtension.h"
#import "COVICell.h"
#import "DMCOVICurrentDataInfo.h"

@interface COVIViewController ()
@property(nonatomic,strong)DMCOVICurrentDataInfo *model;
@end

@implementation COVIViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.preferredContentSize=CGSizeMake(self.view.frame.size.width-80, 125);
    [self.tableView registerNib:[UINib nibWithNibName:@"COVICell" bundle:nil] forCellReuseIdentifier:@"COVICell"];
    self.tableView.bounces                      = NO;
    self.tableView.showsVerticalScrollIndicator = NO;
    self.tableView.separatorStyle = UITableViewCellSelectionStyleNone;


    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return _dataSource.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    COVICell *cell = [tableView dequeueReusableCellWithIdentifier:@"COVICell" forIndexPath:indexPath];
    _model=_dataSource[indexPath.row];
    cell.CO_STATUS.text=_model.CO_DATA;
    //cell.CO_DATA.text=_model.CO_DATA;
    cell.VI_STATUS.text=_model.VI_DATA;
    //cell.VI_DATA.text=_model.VI_DATA;
    cell.LAST_UPDATE.text=_model.LAST_UPDATE;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
